<link type="text/css" href="/admins/js/pagerView/pager-view.css" rel="stylesheet" />
<link type="text/css" href="/admins/js/jquery/css/ui-lightness/jquery-ui-1.8.20.custom.css" rel="stylesheet" />
<script type="text/javascript" src="/admins/js/jquery/jquery-ui-1.8.20.custom.min.js"></script>
<script type="text/javascript" src="/admins/js/jquery/jquery.ui.datepicker-zh-CN.js"></script>
<script type="text/javascript" src="/admins/js/pagerView/pager-view.js"></script>
<script type="text/javascript">
    $(function(){
        $.datepicker.setDefaults( $.datepicker.regional[ "zh-CN" ] );
        $( "#form1 #sel #starttime" ).datepicker({
            changeMonth: true,
            changeYear: true
        });
        $( "#form1 #sel #endtime" ).datepicker({
            changeMonth: true,
            changeYear: true
        });
    });
</script>

<form action="/admini/Autotask/index/"  method="get" style="margin:0px" id="form1">
    <div style=" border:1px solid #DDDDDD; padding:2px; margin:2px;line-height: 36px;" id='sel'> 
          <label for="quick">&nbsp;&nbsp;快速搜索：</label><input type="text" id="name" name="name" value="<?php echo $this->name; ?>" />
        <input type="submit" id="queryButton" name="queryButton" value="查询"/>
    </div>
</form>

<div class="dataTable">
    <table>         
    <tfoot>
      <tr><td colspan="6"><input class="button" id="add-button" type="button" value="添加" /><input class="button" id="del-button" type="button" value="删除" /></td>
     <td colspan="3">
          指派： <select class="select" id="select1" name="zhipai">
                 <option value="1">programerA</option>
                <option value="1">zhangxiaofeng</option>
                <option value="1">programerA</option>
                <option value="1">programerB</option>
           </select>
           <input class="button" id="del-button" type="button" value="启动" />
           <input class="button" id="del-button" type="button" value="工时" />
           <input class="button" id="del-button" type="button" value="完成" />
           <input class="button" id="del-button" type="button" value="关闭" />
           <input class="button" id="del-button" type="button" value="备注" />
    </td></tr>
    </tfoot>
        <tr>
            <th class="w1" width="4px" style="background-color: white;"></th>
            <th class="w2" width="5% " nowrap>任务ID</th>
            <th class="w3" width="10%" nowrap>任务名称</th>
            <th class="w4" width="12%" nowrap>所属分类</th>
            <th class="w5" width="15%" nowrap>任务类型</th>
            <th class="w6" width="15%" nowrap>操作人</th>
            <th class="w7" width="15%" nowrap>添加日期</th>
            <th class="w8" width="15%" nowrap>内容</th>
            <th class="w9" width="12%" nowrap>是否可见</th>
        </tr>  

        <?php
        if ($this->userlist) {
              $Item=$this->userlist;
                ?>
                <tr>
                  
                    <td class="w1" width="5px" align="center"><input type="checkbox" value="<?php echo $Item->id; ?>" class="checkbox-del" name='checkbox'  /></td>     
                    <td class="w2" align="center"><a href="/admini/autotask/edit/id/<?php echo $Item->id;?>"><?php echo $Item->id; ?></a></td>
                    <td class="w3" align="center"><a href="/admini/autotask/edit/id/<?php echo $Item->id;?>"><?php echo $Item->name; ?></a></td>               
                    <td class="w4" align="center"></td>
                    <td class="w5" align="center"></td>
                    <td class="w6" align="center"></td>
                    <td class="w7" align="center"></td>
                    <td class="w8" align="center"></td>
                    <td class="w9" align="center"></td>
                </tr>
        <?php
    }
?>
    </table>
</div>                
<div class="toolbar">
    <?php echo $this->partial('paging.phtml', array("pages" => $this->userall,"pamas"=>"name=".$this->name)); ?>
</div>
<?php
if(isset($this->message) && $this->message!=""){
    echo '<script language="javascript" type="text/javascript">alert("'. $this->message .'")</script>';
}

?>
<script language="javascript">
    $('#add-button').click(function(){
        location.href='/admini/autotask/addjob/';
    });
    $('#del-button').click(function(){
        var idlist = "";
        $('input[name="checkbox"]:checked').each(function(){    
		idlist += $(this).val()+",";
	});
        if(idlist == ''){
            alert("请选择用户");
            return false;
        }else{
            if(confirm("您确定删除该用户？","提示信息")){     
                $.ajax({
                    type: 'POST',
                    url: "/admini/autotask/deljob/idlist/"+idlist,
                    success: function(data) {
                        if(data == 1){
                            alert("删除成功！");
                            location.href='/admini/autotask/index/';
                        }
                    }
                });
            }
        }
    });
</script>

